﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace FHost1.Admin
{
    public partial class Pages : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetPages();
            }
        }

        private void GetPages()
        {
            using (FHostDataContext dataContext = new FHostDataContext())
            {
                GridPages.DataSource = (from obj in dataContext.SitePages select new {obj.PageID, obj.UrlCode, obj.UpdatedDate, obj.Title });
                GridPages.DataBind();
            }
        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/EditPage.aspx?pid=new");
        }

        protected void lnkDelete_Click(object sender, EventArgs e)
        {

        }
    }
}